home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / include / gtk-2.0 / gtk / gtkdnd.h < prev    next >
Encoding:
C/C++ Source or Header  |  2006-04-25  |  6.2 KB  |  181 lines

  1. /* GTK - The GIMP Toolkit
  2.  * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
  3.  *
  4.  * This library is free software; you can redistribute it and/or
  5.  * modify it under the terms of the GNU Lesser General Public
  6.  * License as published by the Free Software Foundation; either
  7.  * version 2 of the License, or (at your option) any later version.
  8.  *
  9.  * This library is distributed in the hope that it will be useful,
  10.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12.  * Lesser General Public License for more details.
  13.  *
  14.  * You should have received a copy of the GNU Lesser General Public
  15.  * License along with this library; if not, write to the
  16.  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  17.  * Boston, MA 02111-1307, USA.
  18.  */
  19.  
  20. /*
  21.  * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
  22.  * file for a list of people on the GTK+ Team.  See the ChangeLog
  23.  * files for a list of changes.  These files are distributed with
  24.  * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 
  25.  */
  26.  
  27. #ifndef __GTK_DND_H__
  28. #define __GTK_DND_H__
  29.  
  30. #include <gdk/gdk.h>
  31. #include <gtk/gtkenums.h>
  32. #include <gtk/gtkwidget.h>
  33. #include <gtk/gtkselection.h>
  34.  
  35. G_BEGIN_DECLS
  36.  
  37. typedef enum {
  38.   GTK_DEST_DEFAULT_MOTION     = 1 << 0, /* respond to "drag_motion" */
  39.   GTK_DEST_DEFAULT_HIGHLIGHT  = 1 << 1, /* auto-highlight */
  40.   GTK_DEST_DEFAULT_DROP       = 1 << 2, /* respond to "drag_drop" */
  41.   GTK_DEST_DEFAULT_ALL        = 0x07
  42. } GtkDestDefaults;
  43.  
  44. /* Flags for the GtkTargetEntry on the destination side 
  45.  */
  46. typedef enum {
  47.   GTK_TARGET_SAME_APP = 1 << 0,    /*< nick=same-app >*/
  48.   GTK_TARGET_SAME_WIDGET = 1 << 1  /*< nick=same-widget >*/
  49. } GtkTargetFlags;
  50.  
  51. /* Destination side */
  52.  
  53. void gtk_drag_get_data (GtkWidget      *widget,
  54.             GdkDragContext *context,
  55.             GdkAtom         target,
  56.             guint32         time_);
  57. void gtk_drag_finish   (GdkDragContext *context,
  58.             gboolean        success,
  59.             gboolean        del,
  60.             guint32         time_);
  61.  
  62. GtkWidget *gtk_drag_get_source_widget (GdkDragContext *context);
  63.  
  64. void gtk_drag_highlight   (GtkWidget  *widget);
  65. void gtk_drag_unhighlight (GtkWidget  *widget);
  66.  
  67. void gtk_drag_dest_set   (GtkWidget            *widget,
  68.               GtkDestDefaults       flags,
  69.                     const GtkTargetEntry *targets,
  70.               gint                  n_targets,
  71.               GdkDragAction         actions);
  72.  
  73. void gtk_drag_dest_set_proxy (GtkWidget      *widget,
  74.                   GdkWindow      *proxy_window,
  75.                   GdkDragProtocol protocol,
  76.                   gboolean        use_coordinates);
  77.  
  78. void gtk_drag_dest_unset (GtkWidget          *widget);
  79.  
  80. GdkAtom        gtk_drag_dest_find_target     (GtkWidget      *widget,
  81.                                               GdkDragContext *context,
  82.                                               GtkTargetList  *target_list);
  83. GtkTargetList* gtk_drag_dest_get_target_list (GtkWidget      *widget);
  84. void           gtk_drag_dest_set_target_list (GtkWidget      *widget,
  85.                                               GtkTargetList  *target_list);
  86. void           gtk_drag_dest_add_text_targets  (GtkWidget    *widget);
  87. void           gtk_drag_dest_add_image_targets (GtkWidget    *widget);
  88. void           gtk_drag_dest_add_uri_targets   (GtkWidget    *widget);
  89.  
  90. /* Source side */
  91.  
  92. void gtk_drag_source_set  (GtkWidget            *widget,
  93.                GdkModifierType       start_button_mask,
  94.                const GtkTargetEntry *targets,
  95.                gint                  n_targets,
  96.                GdkDragAction         actions);
  97.  
  98. void gtk_drag_source_unset (GtkWidget        *widget);
  99.  
  100. GtkTargetList* gtk_drag_source_get_target_list (GtkWidget     *widget);
  101. void           gtk_drag_source_set_target_list (GtkWidget     *widget,
  102.                                                 GtkTargetList *target_list);
  103. void           gtk_drag_source_add_text_targets  (GtkWidget     *widget);
  104. void           gtk_drag_source_add_image_targets (GtkWidget    *widget);
  105. void           gtk_drag_source_add_uri_targets   (GtkWidget    *widget);
  106.  
  107. void gtk_drag_source_set_icon        (GtkWidget   *widget,
  108.                       GdkColormap *colormap,
  109.                       GdkPixmap   *pixmap,
  110.                       GdkBitmap   *mask);
  111. void gtk_drag_source_set_icon_pixbuf (GtkWidget   *widget,
  112.                       GdkPixbuf   *pixbuf);
  113. void gtk_drag_source_set_icon_stock  (GtkWidget   *widget,
  114.                       const gchar *stock_id);
  115. void gtk_drag_source_set_icon_name   (GtkWidget   *widget,
  116.                       const gchar *icon_name);
  117.  
  118. /* There probably should be functions for setting the targets
  119.  * as a GtkTargetList
  120.  */
  121.  
  122. GdkDragContext *gtk_drag_begin (GtkWidget         *widget,
  123.                 GtkTargetList     *targets,
  124.                 GdkDragAction      actions,
  125.                 gint               button,
  126.                 GdkEvent          *event);
  127.  
  128. /* Set the image being dragged around
  129.  */
  130. void gtk_drag_set_icon_widget (GdkDragContext *context,
  131.                    GtkWidget      *widget,
  132.                    gint            hot_x,
  133.                    gint            hot_y);
  134. void gtk_drag_set_icon_pixmap (GdkDragContext *context,
  135.                    GdkColormap    *colormap,
  136.                    GdkPixmap      *pixmap,
  137.                    GdkBitmap      *mask,
  138.                    gint            hot_x,
  139.                    gint            hot_y);
  140. void gtk_drag_set_icon_pixbuf (GdkDragContext *context,
  141.                    GdkPixbuf      *pixbuf,
  142.                    gint            hot_x,
  143.                    gint            hot_y);
  144. void gtk_drag_set_icon_stock  (GdkDragContext *context,
  145.                    const gchar    *stock_id,
  146.                    gint            hot_x,
  147.                    gint            hot_y);
  148. void gtk_drag_set_icon_name   (GdkDragContext *context,
  149.                    const gchar    *icon_name,
  150.                    gint            hot_x,
  151.                    gint            hot_y);
  152.  
  153. void gtk_drag_set_icon_default (GdkDragContext    *context);
  154.  
  155. gboolean gtk_drag_check_threshold (GtkWidget *widget,
  156.                    gint       start_x,
  157.                    gint       start_y,
  158.                    gint       current_x,
  159.                    gint       current_y);
  160.  
  161. /* Internal functions */
  162. void _gtk_drag_source_handle_event (GtkWidget *widget,
  163.                     GdkEvent  *event);
  164. void _gtk_drag_dest_handle_event (GtkWidget *toplevel,
  165.                   GdkEvent  *event);
  166.  
  167. #ifndef GTK_DISABLE_DEPRECATED
  168. void gtk_drag_set_default_icon (GdkColormap   *colormap,
  169.                 GdkPixmap     *pixmap,
  170.                 GdkBitmap     *mask,
  171.                     gint           hot_x,
  172.                     gint           hot_y);
  173. #endif /* !GTK_DISABLE_DEPRECATED */
  174.  
  175. G_END_DECLS
  176.  
  177. #endif /* __GTK_DND_H__ */
  178.  
  179.  
  180.  
  181.